#include "mytask.h"
#include <QDebug>

MyTask::MyTask(int argumnet, QObject *parent)
    : QObject(parent)
    , QRunnable()
    , Argument(argumnet)
{
    qDebug() << "MyTask()";
}

MyTask::~MyTask()
{

}

void MyTask::run()
{
    qDebug() << "Task started.";

    int iNumber = 0;
    for (int i = Argument; i <= 100; ++i){
        iNumber += i;
    }
    qDebug() << "Task Result: " << iNumber;
    qDebug() << "Task done.";

    emit Result(iNumber);
}

